<script type="text/javascript">
    $(function(){
        $("#qx_gnczList_id").combobox({
            onLoadSuccess:function(){
                var gnczIds = $("td[name='gncz'] [name='qx_gnczList']").map(function(){
                    return $(this).val();
                });
                $("#qx_gnczList_id").combobox("setValues",gnczIds);
            }
        });
        $("#qx_ymysList_id").combobox({
            onLoadSuccess:function(){
                var ymysIds = $("td[name='ymys'] [name='qx_ymysList']").map(function(){
                    return $(this).val();
                });
                $("#qx_ymysList_id").combobox("setValues",ymysIds);
            }
        });
    });
</script>
<form id="qxForm" action="${base}/sys/qx/qx" method="post">
    <input name="qx.id" type="hidden" value="${(qx.id)!''}"/>
    <table style="width: 100%" class="tb tb-con">
        <col width="25.5%"/><col width="12.5%"/><col width="22.5%"/><col width="57.5%"/>
        <tr>
            <th style="color:#f45212;">名&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称：</th>
            <td><input name="qx.mc" type="text" class="easyui-validatebox input-text" required="true"
                       validType="remote['${base}/sys/qx/ajax_validate?qxId=${(qx.id)!}',{'validateField':'mc'},'权限名称不能重复！']" value="${(qx.mc)!''}"/></td>
            <th style="color:#f45212;">菜&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;单：</th>
            <td>
                <input name="qx.cd.id" type="text" value="" class="easyui-combotree input-text" required="true"
                       missingMessage="菜单不能为空！" data-options="url:'${base}/sys/cd/get_cdtree',panelHeight:'200'"/>
            </td>
        </tr>
        <tr>
            <th>功能操作：</th>
            <td name="gncz">
                <input name="qx.gnczList.id" type="text" value="" class="easyui-combobox input-text" id="qx_gnczList_id"
                                   data-options="url:'${base}/sys/cd/get_gncz?cdId=${(qx.cd.id)!}', valueField:'id',textField:'mc', multiple:true,panelHeight:'200'"/>
            <#if (qx.gnczList)??>
                <#list qx.gnczList as qx>
                    <#if (qx.id)??>
                        <input type="hidden" name="qx_gnczList" value="${(qx.id)!}"/>
                    </#if>
                </#list>
            </#if>
            </td>
            <th>页面元素：</th>
            <td name="ymys">
                <input name="qx.ymysList.id" type="text" value="" class="easyui-combobox input-text" id="qx_ymysList_id"
                                   data-options="url:'${base}/sys/cd/get_ymys?cdId=${(qx.cd.id)!}', valueField:'id',textField:'mc', multiple:true,panelHeight:'200'"/>
            <#if (qx.ymysList)??>
                <#list qx.ymysList as qx>
                    <#if (qx.id)??>
                        <input type="hidden" name="qx_ymysList" value="${(qx.id)!}"/>
                    </#if>
                </#list>
            </#if>
            </td>
        </tr>
    </table>
    <div style="padding:5px 0;text-align:right;padding-right:30px">
        <a href="#" class="easyui-linkbutton" iconcls="icon-save" plain="true"
           onclick="qx_saveItem('${index}')">保存</a>
        <a href="#" class="easyui-linkbutton" iconcls="icon-cancel" plain="true"
           onclick="qx_cancelItem('${index}')">取消</a>
    </div>
</form>
